package com.learn.book;

import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

public class MyThread implements Callable {

    MyThread myThread;

    public static void main(String[] args) throws ExecutionException, InterruptedException {
        FutureTask<String> ft = new FutureTask<>(new MyThread());
        new Thread(ft).start();
        String result = ft.get();
        System.out.println(result);
        synchronized (MyThread.class) {

        }
    }

    @Override
    public Object call() throws Exception {
        // TODO Auto-generated method stub
        System.out.println("=====");
        return "9999";
    }
}
